/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session04;

import java.util.ArrayList;
import java.util.List;
import javax.swing.AbstractListModel;

/**
 *
 * @author macbookpro
 */
public class StudentListModel extends AbstractListModel {

    private List<Student> data;

    public StudentListModel(List<Student> data) {
        if (data == null) {
            this.data = new ArrayList();
        }
        this.data = data;
    }

    @Override
    public int getSize() {
        return data.size();
    }

    @Override
    public Object getElementAt(int index) {
        return data.get(index);
    }
}
